package com.leyu.mall.service.goods.impl;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.leyu.mall.common.facade.IGoodsMobileFacade;
import com.leyu.mall.dao.goods.GoodsMobileMapper;
import com.leyu.mall.domain.goods.GoodsMobile;
import com.leyu.mall.service.goods.IGoodsMobileService;

@Service
@Transactional(rollbackFor = Exception.class)
public class GoodsMobileServiceImpl implements IGoodsMobileService,IGoodsMobileFacade {

	@Resource(name = "goodsMobileMapper")
	private GoodsMobileMapper goodsMobileMapper;

	public GoodsMobile getGoodsMobileById(Long entity_id) throws Exception {
		return goodsMobileMapper.getGoodsMobileById(entity_id);
	}

	public void save(GoodsMobile entity) throws Exception {
		if (entity.getMobileId()==null){
			goodsMobileMapper.addGoodsMobile(entity);

		} else {

			goodsMobileMapper.updateByPrimaryKey(entity);
		}
	}
	public void deleteGoodsMobile(Long id) throws Exception {
		goodsMobileMapper.deleteGoodsMobile(id);
	}
	public List<GoodsMobile> getAllGoodsMobile() throws Exception {
		return goodsMobileMapper.getAllGoodsMobile();

	}
	
 
	
}